package com.small.site.constant;

/**
 * @author xiaochi
 * @date 2021/12/11 22:13
 * @desc 常量
 */
public interface Constant {

    String CAPTCHA_CODE = "CAPTCHA_CODE";

    int BYTE_BUFFER = 1024;

    int BUFFER_MULTIPLE = 10;

    //验证码过期时间
    Long PASS_TIME =  50000 * 60 *1000L;

    //根菜单节点
    String ROOT_MENU = "0";

    //菜单类型，1：菜单  2：按钮操作
    int TYPE_MENU = 1;

    //菜单类型，1：菜单  2：按钮操作
    int TYPE_BUTTON = 2;

    //用户名登录
    int LOGIN_USERNAME = 0;
    //手机登录
    int LOGIN_MOBILE = 1;
    //邮箱登录
    int LOGIN_EMAIL = 2;

    //启用
    int ENABLE = 1;
    //禁用
    int DISABLE = 0;

    interface RoleType{
        //超级管理员
        String SYS_ASMIN_ROLE= "sysadmin";
        //管理员
        String ADMIN= "admin";
        //普通用户
        String USER= "user";
    }

    interface User{

        /**
         * user缓存key
         */
        String USER_KEY = "user::";

        /**
         * user token 缓存key
         */
        String USER_TOKEN_KEY = "user::token::";

        /**
         * user缓存key时长
         */
        long USER_KEY_EXPIRE = 86400L;// 缓存一天

        /**
         * 权限缓存key
         */
        String PERMISSION_KEY = "permission::";

        /**
         * token key
         */
        String ACCESS_TOKEN = "Authorization";

        /**
         * 用于从 token 中获取用户id
         */
        String JWT_USER_ID = "jwt-user-id-key";
    }


   interface FilePostFix{
        String ZIP_FILE =".zip";

        String[] IMAGES ={"jpg", "jpeg", "JPG", "JPEG", "gif", "GIF", "bmp", "BMP", "png"};
        String[] ZIP ={"ZIP","zip","rar","RAR"};
        String[] VIDEO ={"mp4","MP4","mpg","mpe","mpa","m15","m1v", "mp2","rmvb"};
        String[] APK ={"apk","exe"};
        String[] OFFICE ={"xls","xlsx","docx","doc","ppt","pptx"};

    }
    interface FileType{
        int FILE_IMG = 1;
        int FILE_ZIP = 2;
        int FILE_VEDIO= 3;
        int FILE_APK = 4;
        int FIVE_OFFICE = 5;
        String FILE_IMG_DIR= "/img/";
        String FILE_ZIP_DIR= "/zip/";
        String FILE_VEDIO_DIR= "/video/";
        String FILE_APK_DIR= "/apk/";
        String FIVE_OFFICE_DIR= "/office/";
    }
}
